package com.test.sdk.pay;

import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

/**
 * @author 徒有琴
 */
@SpringBootApplication
public class SdkPayStarter {
    public static void main(String[] args) {
        SpringApplication.run(SdkPayStarter.class, args);
    }

    @Bean
    public ConnectionFactory connectionFactory() {
        CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory();
        cachingConnectionFactory.setHost("www.vm.com");
        cachingConnectionFactory.setPort(5672);
        cachingConnectionFactory.setUsername("luke");
        cachingConnectionFactory.setPassword("luke");
        cachingConnectionFactory.setVirtualHost("/test");
        cachingConnectionFactory.setPublisherReturns(true);
        cachingConnectionFactory.setPublisherConfirms(true);
        return cachingConnectionFactory;
    }
}
